home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 2
/
Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso
/
Aminet
/
misc
/
amag
/
am9305d.lha
/
EGS.lha
/
EGS
/
EGS_Devels
/
doc
/
egsgfx.doc
< prev
next >
Wrap
Text File
|
1993-03-18
|
20KB
|
1,010 lines
/*
* $
* $ FILE : egsgfx.doc
* $ VERSION : 1
* $ REVISION : 1
* $ DATE : 08-Feb-93 10:04
* $
* $ Author : mvk
* $
*
*
* (c) Copyright 1990/93 VIONA Development
* All Rights Reserved
*
*/
egsgfx.library/EG_AreaCircle
egsgfx.library/EG_AreaCurve
egsgfx.library/EG_AreaCurveL
egsgfx.library/EG_AreaDraw
egsgfx.library/EG_AreaEnd
egsgfx.library/EG_AreaMove
egsgfx.library/EG_CloseFont
egsgfx.library/EG_CopyBitMapRastPort
egsgfx.library/EG_CopyRectangle
egsgfx.library/EG_CreateRastPort
egsgfx.library/EG_Curve
egsgfx.library/EG_CurveL
egsgfx.library/EG_DeleteRastPort
egsgfx.library/EG_Draw
egsgfx.library/EG_Ellipse
egsgfx.library/EG_FillMask
egsgfx.library/EG_FillMaskSeg
egsgfx.library/EG_Flood
egsgfx.library/EG_InitArea
egsgfx.library/EG_InstallClipRegion
egsgfx.library/EG_Move
egsgfx.library/EG_OpenFont
egsgfx.library/EG_ReadPixel
egsgfx.library/EG_RectFill
egsgfx.library/EG_RemoveClipRegion
egsgfx.library/EG_ScrollRastPort
egsgfx.library/EG_SetAPen
egsgfx.library/EG_SetBPen
egsgfx.library/EG_SetDrMd
egsgfx.library/EG_SetFont
egsgfx.library/EG_SetMask
egsgfx.library/EG_SetSoftStyle
egsgfx.library/EG_StdFont
egsgfx.library/EG_Text
egsgfx.library/EG_TextLength
egsgfx.library/EG_WritePixel
egsgfx.library/EG_AreaCircle
NAME
EG_AreaCircle draw a filled circle
SYNOPSIS
EG_AreaCircle(rast, x, y, r)
A0 D0 D1 D2
EG_RastPortPtr rast;
WORD x, y, r;
FUNCTION
Draws a filled circle in the aPen color. This function requiers a tmpRas
bitmap. If there is none, it allocates one and frees it afterwards. This
allocation requiers time, which can be saved by allocating an own tmpRas
bitmap for the rastport.
INPUTS
rast : rastport in which to draw
x, y : centre of the circle
r : radius
RETURNS
egsgfx.library/EG_AreaCurve
NAME
EG_AreaCurve draw a filled bezier curve
SYNOPSIS
EG_AreaCurve(rast, x2, y2, x3, y3, x4, y4)
A0 D0 D1 D2 D3 D4 D5
EG_RastPortPtr rast;
WORD x2, y2, x3, y3, x4, y4;
FUNCTION
Adds a bezier curve to a filled object (see also AreaMove, AreaDraw and
AreaEnd). The curve is halved until the pieces are smaller then the limit
given in the rastport. Then the pieces are drawn using AreaDraw. This
function requiers a large areaInfo structure. The current area cursor
in the rastport is the starting location, the point x4/y4 is the end
location.
INPUTS
rast : destination rastport
x2, y2 : direction at curve start
x3, y3 : direction at curve end
x4, y4 : endpoint
RETURNS
egsgfx.library/EG_AreaCurveL
NAME
EG_AreaCurveL draw a filled bezier curve
SYNOPSIS
EG_AreaCurveL(rast, x2, y2, x3, y3, x4, y4)
A0 D0 D1 D2 D3 D4 D5
EG_RastPortPtr rast;
LONG x2, y2, x3, y3;
WORD x4, y4;
FUNCTION
Adds a bezier curve to a filled object (see also AreaMove, AreaDraw and
AreaEnd). The curve is halved until the pieces are smaller then the limit
given in the rastport. Then the pieces are drawn using AreaDraw. This
function requiers a large areaInfo structure. The current area cursor
in the rastport is the starting location, the point x4/y4 is the end
location. The values of x2 to y3 are 32 bit fractionals with the
fractional part starting at bit 16. This function is usefull to draw small
curves very accurate.
EXAMPLE
This function can be used to draw a filled ellipse.
x, y : median
a, b : halfaxis
AreaMove(rast, x, y-b);
AreaCurveL(rast, 36194*a, 0, 0, -36194*b, x+a, y);
AreaCurveL(rast, 0, 36194*b, 36194*a, 0, x, y+b);
AreaCurveL(rast, -36194*a, 0, 0, 36194*b, x-a, y);
AreaCurveL(rast, 0, -36194*b, -36194*a, 0, x, y-b);
AreaEnd(rast);
INPUTS
rast : destination rastport
x2, y2 : direction at curve start (multiplied by 65536)
x3, y3 : direction at curve end (multiplied by 65536)
x4, y4 : endpoint
RETURNS
egsgfx.library/EG_AreaDraw
NAME
EG_AreaDraw draw a edge of a filled polygon
SYNOPSIS
EG_AreaDraw(rast, x, y)
A0 D0 D1
EG_RastPortPtr rast;
WORD x, y;
FUNCTION
Adds an edge to a filled polygon (see also AreaMove, AreaCurve and
AreaEnd). The polygon is drawn using AreaEnd. This function requires a
areaInfo structure attached to the rastPort.
INPUTS
rast : destination rastport
x, y : end of line, startpoint is current areacursor location.
RETURNS
egsgfx.library/EG_AreaEnd
NAME
EG_AreaEnd end area polygon definition and draw
SYNOPSIS
EG_AreaEnd(rast)
A0
EG_RastPortPtr rast;
FUNCTION
Ends an open area polygon and draws it, using the aPen color. This function
needs a tmpRas bitmap. If there is none the function creates one and frees
it afterwards.
INPUTS
RETURNS
egsgfx.library/EG_AreaMove
NAME
EG_AreaMove begin new area polygon
SYNOPSIS
EG_AreaMove(rast, x, y)
A0 D0 D1
EG_RastPortPtr rast;
WORD x, y;
FUNCTION
Moves the area cursor to a new starting location. Closes an open polygon.
You can draw several polygons with one AreaEnd. If the polygons intersect
each other the intersection will be excluded (exclusiv or). This can be
used to draw free areas in polygons.
INPUTS
RETURNS
egsgfx.library/EG_CloseFont
NAME
EG_CloseFont close a font
SYNOPSIS
EG_CloseFont(font)
A0
EG_EFontPtr font;
FUNCTION
Close a font which was opened using EG_OpenFont.
INPUTS
RETURNS
egsgfx.library/EG_CopyBitMapRastPort
NAME
EG_CopyBitMapRastPort copy rectangle of a bitmap into a rastport
SYNOPSIS
EG_CopyBitMapRastPort(src, rast, xs, ys, w, h, xd, yd)
A0 A1 D0 D1 D2 D3 D4 D5
E_EBitMapPtr src;
EG_RastPortPtr rast;
WORD xs, ys, w, h, xd, yd;
FUNCTION
Copies a rectangluar area from a bitmap into a rastport. Clipping is
done for the destination rastport as specified.
INPUTS
src : source bitmap
rast : destination rastport
xs, ys : starting location in the bitmap
w, h : dimensions of the rectangle
xd, yd : destination location in the rastport
RETURNS
egsgfx.library/EG_CopyRectangle
NAME
EG_CopyRectangle copy rectangle of a rastport into a rastport
SYNOPSIS
EG_CopyBitMapRastPort(src, dst, xs, ys, w, h, xd, yd)
A0 A1 D0 D1 D2 D3 D4 D5
EG_RastPortPtr src, dst;
WORD xs, ys, w, h, xd, yd;
FUNCTION
Copies a rectangluar area from a rastport into a rastport. Clipping is
done for the destination rastport as specified. The source should not
exceed the limits of its rastport. The two rastports may be identical
INPUTS
src : source rastport
rast : destination rastport
xs, ys : starting location in the source rastport
w, h : dimensions of the rectangle
xd, yd : destination location in the destination rastport
RETURNS
egsgfx.library/EG_CheckRectangle
NAME
EG_CheckRectangle checks if rectangle in inside current clipping area
SYNOPSIS
writable = EG_CheckRectangle (rport, rect);
D0 A1 A2
EG_RastPortPtr rport;
EB_ClipRectPtr rect;
BOOL writable;
FUNCTION
Checks the rect against the current clipping region and finds out if the
area specified in rect is completely clipped out or not.
This is useful during refresh of windows where some areas could take
a long time to refresh. If this function, however, returns FALSE, there
is no need to refresh the rectangle in question. This function is quite
fast, and compared to e.g. loading a bitmap from disk or rendering text
or graphic elements, the time is well spent.
INPUTS
rport : rastport in question
rect : rectangle to check
RETURNS
TRUE - if at least one pixel in the specified rectangle is writable, and
updating the area will have an effect.
FALSE - if the entire area specified in rect is clipped out, and
rendering into the area will have no effect at all.
egsgfx.library/EG_CreateRastPort
NAME
EG_CreateRastPort create a rastport
SYNOPSIS
rport = EG_CreateRastPort(layer, screen, map)
D0 A0 A1 A2
EG_RastPortPtr rport;
EL_LayerPtr layer;
E_EScreenPtr screen;
E_EBitMapPtr map;
FUNCTION
Creates a rastport for a layer, a screen or a bitmap.
If a screen is specified, it is used for MouseOn/MouseOff.
If neither a layer nor a map is specified, the destination bitmap will
be that of the screen. A layer and a bitmap exclude each other.
You are allowed to use several RastPorts for one object in order to work
more independent. If layers are used then even several tasks may use
the same RastPort simultaneously.
INPUTS
layer : layer on which to create or NULL, for a non layer rastport
screen : screen, on which the rastport resides or NULL, if the rastport
is not on a screen
map : bitmap on which the rastport exists or NULL
RETURNS
egsgfx.library/EG_Curve
NAME
EG_Curve draw a bezier curve
SYNOPSIS
EG_Curve(rast, x2, y2, x3, y3, x4, y4)
A0 D0 D1 D2 D3 D4 D5
EG_RastPortPtr rast;
WORD x2, y2, x3, y3, x4, y4;
FUNCTION
Draws a bezier curve. The curve is halfed until the pieces are smaller
as in the rastport defined. Then the curve is drawn using draw.
The current cursor in the rastport is the starting location, the point x4/y4
is the end location. The point x2/y2 is a relative vector to the starting
point, x3/y3 is a relative vector to the ending point. This to vectors
specify the curves dirction.
INPUTS
rast : destination rastport
x2, y2 : direction at curve start
x3, y3 : direction at curve end
x4, y4 : endpoint
RETURNS
egsgfx.library/EG_CurveL
NAME
EG_CurveL draw a bezier curve
SYNOPSIS
EG_CurveL(rast, x2, y2, x3, y3, x4, y4)
A0 D0 D1 D2 D3 D4 D5
EG_RastPortPtr rast;
LONG x2, y2, x3, y3;
WORD x4, y4;
FUNCTION
Draws a bezier curve. The curve is halfed until the pieces are smaller
as in the rastport defined. Then the curve is drawn using draw.
The current cursor in the rastport is the starting location, the point x4/y4
is the end location. The point x2/y2 is a relative vector to the starting
point, x3/y3 is a relative vector to the ending point. This to vectors
specify the curves dirction. The values of x2 to y3 must be given as a 32
bit fractional number with the fractional part starting at bit 16. This is
usefull to draw small curves very accurate.
INPUTS
rast : destination rastport
x2, y2 : direction at curve start (multipiled by 65536)
x3, y3 : direction at curve end (multipiled by 65536)
x4, y4 : endpoint
RETURNS
egsgfx.library/EG_DeleteRastPort
NAME
EG_DeleteRastPort deletes a rastport
SYNOPSIS
EG_DeleteRastPort(rast)
A0
EG_RastPortPtr rast;
FUNCTION
Deletes a rastport which was createt using EG_CreateRastPort
INPUTS
RETURNS
egsgfx.library/EG_Draw
NAME
EG_Draw draws a line
SYNOPSIS
EG_Draw(rast, x, y)
A0 D0 D1
EG_RastPortPtr rast;
WORD x, y;
FUNCTION
Draws a line from the current cursor location to x, y. The cursor location
becomes x, y. The line is clipped according to the rastport.
INPUTS
RETURNS
egsgfx.library/EG_Ellipse
NAME
EG_Ellipse draws an ellipse
SYNOPSIS
EG_Ellipse(rast, x, y, a, b)
A0 D0 D1 D2 D3
EG_RastPortPtr rast;
WORD x, y, a, b;
FUNCTION
Draws an ellipse, around x, y the horizontal halfaxis is a, the vertical
is b. This function uses Curve, so the resolution of the ellipse depends
on the curvStep field of the rastport.
INPUTS
RETURNS
egsgfx.library/EG_FillMask
NAME
EG_FillMask copies a one bit deep bitmap to a rastport
SYNOPSIS
EG_FillMask(rast, src, xd, yd)
A0 A1 D0 D1
EG_RastPortPtr rast;
E_EBitMapPtr src;
WORD xd, yd;
FUNCTION
Copies a one bitplane deep bitmap into a rastport, using aPen and bPen,
or aPen and transparency.
INPUTS
rast : destination rastport
src : source bitmap
xd, yd : destination location
RETURNS
egsgfx.library/EG_FillMaskSeg
NAME
EG_FillMaskSeg copies a rectangle of an one bit deep bitmap to a rastport
SYNOPSIS
EG_FillMask(rast, src, xs, ys, w, h, xd, yd)
A0 A1 D0 D1 D2 D3 D4 D5
EG_RastPortPtr rast;
E_EBitMapPtr src;
WORD xs, ys, w, h, xd, yd;
FUNCTION
Copies a rectangle out of an one bitplane deep bitmap into a rastport, using
aPen and bPen, or aPen and transparency.
INPUTS
rast : destination rastport
src : source bitmap
xs, ys : starting locations in source bitmap
w, h : size of rectangular area
xd, yd : destination location
RETURNS
egsgfx.library/EG_Flood
NAME
EG_Flood Flood rastport like areafill.
SYNOPSIS
EG_Flood(rp, mode, x, y)
a1 d2 d0 d1
EG_RastPortPtr rast;
WORD x, y;
FUNCTION
Fill all adjacent pixels to (x,y) if they are:
Mode 0: Different color than APen
Mode 1: The same color as the pixel at (x,y)
INPUTS
rp : pointer to EG_RastPort
(x,y) : coordinate in bitmap to start the flood fill at.
mode - 0 fill all adjacent pixels searching for border of color APen.
1 fill all adjacent pixels that have same pen number
as the one at (x,y).
NOTES
Having temporary in the rastport will speed up flood filling.
egsgfx.library/EG_InitArea
NAME
EG_InitArea init area info structure
SYNOPSIS
iinfo = EG_InitArea(info, buffer, size)
D0 A0 A1 D0
EG_AreaInfoPtr iinfo, info;
APTR buffer;
WORD size;
FUNCTION
Initializes an areainfo structure.
INPUTS
info : unintialized areainfo structure
buffer : pointer to a memory area for areapolygon vertices
size : number of vertices that can be stored in this buffer
RETURNS
initialized area info structure, that can be assigned to a rastport
egsgfx.library/EG_InstallClipRegion
NAME
EG_InstallClipRegion installs a clip region
SYNOPSIS
EG_InstallClipRegion(rast, rect)
A0 A1
EG_RastPortPtr rast;
EB_ClipRectPtr rect;
FUNCTION
ClipRegions describe which regions of a RastPort may be written into.
If a RastPort has no ClipRegion (only possible for unlayered RastPorts)
there might be some drawing outside the BitMap. On the other hand, drawing
without clipping is slightly faster.
If the RastPort uses a layer an additional ClipRegion restricts the
ordinary rectangular drawing region.
A RastPort's ClipRegion consists of a list of ClipRects. That list is
not changed by the EGSGfx library, i.e. a constant list is allowed.
Before deleting a RastPort its ClipRegion should be removed.
The ClipRegion must not be changed while it is connected to the RastPort.
The old ClipRegion gets lost, so it should be removed using
EB_RemoveClipRegin before, or cached in a variable.
INPUTS
RETURNS
egsgfx.library/EG_Move
NAME
EG_Move move graphics cursor
SYNOPSIS
EG_Move(rast, x, y)
A0 D0 D1
EG_RastPortPtr rast;
WORD x, y;
FUNCTION
Moves the graphic cursor to x, y.
INPUTS
RETURNS
egsgfx.library/EG_OpenFont
NAME
EG_OpenFont opens a font
SYNOPSIS
font = EG_OpenFont(attr)
D0 A0
EG_EFontPtr font;
TextAttr * attr;
FUNCTION
Opens a diskfont, and does some additional work, to optimize text rendering.
INPUTS
attr : TextAttr structure known from graphics
RETURNS
an open font (EG_EFont) or NULL if not successfull
egsgfx.library/EG_ReadPixel
NAME
EG_ReadPixel reads a pixel
SYNOPSIS
color = EG_ReadPixel(rast, x, y)
D0 A0 D0 D1
ULONG color;
EG_RastPortPtr rast;
WORD x, y;
FUNCTION
Returns a pixels color.
INPUTS
RETURNS
color or -1 if the color can not be find
egsgfx.library/EG_RectFill
NAME
EG_RectFill fill rectangular area
SYNOPSIS
EG_RectFill(rast, x, y, w, h)
A0 D0 D1 D2 D3
EG_RastPortPtr rast;
WORD x, y, w, h;
FUNCTION
Fills a rectangular area according to the actual drawmode and aPen.
INPUTS
RETURNS
egsgfx.library/EG_RemoveClipRegion
NAME
EG_RemoveClipRegion remove clipregion
SYNOPSIS
rect = EG_RemoveClipRegion(rast)
D0 A0
EB_ClipRectPtr rect;
EG_RastPortPtr rast;
FUNCTION
Removes the current clip region from a rastport, and returns it. All
later graphics operations are only clipped using layer information.
INPUTS
RETURNS
the old clipregion
egsgfx.library/EG_ScrollRastPort
NAME
EG_ScrollRastPort scroll rectangular area in a rastport
SYNOPSIS
EG_ScrollRastPort(rast, xs, ys, w, h, dx, dy)
A0 D0 D1 D2 D3 D4 D5
EG_RastPortPtr rast;
WORD xs, ys, w, h, dx, dy;
FUNCTION
Scrolls a rectangular area in a rastport. Modiies the damage list of
a layer if necessary and sends a refresh message.
INPUTS
rast : destination rastport
xs, ys : upper left edge
w, h : size of rectangular area
dx, dy : destination and amount in which to scroll
RETURNS
egsgfx.library/EG_SetAPen
NAME
EG_SetAPen modifies froeground pen
SYNOPSIS
EG_SetAPen(rast, color)
A0 D0
EG_RastPortPtr rast;
ULONG color;
FUNCTION
Modifies the color of the froeground pen.
INPUTS
RETURNS
egsgfx.library/EG_SetBPen
NAME
EG_SetBPen modifies background pen
SYNOPSIS
EG_SetBPen(rast, color)
A0 D0
EG_RastPortPtr rast;
ULONG color;
FUNCTION
Modifies the color of the background pen.
INPUTS
RETURNS
egsgfx.library/EG_SetDrMd
NAME
EG_SetDrMd modifies the current drawmode
SYNOPSIS
EG_SetDrMd(rast, mode)
A0 D0
EG_RastPortPtr rast;
UBYTE mode;
FUNCTION
Modifies the current drawmode to mode.
INPUTS
RETURNS
egsgfx.library/EG_SetFont
NAME
EG_SetFont defines current font
SYNOPSIS
EG_SetFont(rast, font)
A0 A1
EG_RastPortPtr rast;
EG_EFontPtr font;
FUNCTION
Sets a new font for a rastport. This has to be a EG_EFont, which has been
opened using EG_OpenFont.
INPUTS
RETURNS
egsgfx.library/EG_SetMask
NAME
EG_SetMask
SYNOPSIS
EG_SetMask(rast, mask)
A0 D0
EG_RastPortPtr rast;
ULONG mask;
FUNCTION
INPUTS
RETURNS
egsgfx.library/EG_SetSoftStyle
NAME
EG_SetSoftStyle
SYNOPSIS
old = EG_SetSoftStyle(rast, style, mask)
D0 A0 D0 D1
EG_RastPortPtr rast;
ULONG style, mask, old;
FUNCTION
Sets a text softwarestyle for an rastport.
INPUTS
style : new values
nask : mask for bits to change
RETURNS
egsgfx.library/EG_StdFont
NAME
EG_StdFont
SYNOPSIS
font = EG_StdFont()
D0
EG_EFontPtr font;
FUNCTION
The EGSBlit library has a special font which can be written extremely
quick. That font (8 by 10 Pixels non-proportional) should be used whenever
fast text output is wanted. As it must not be opened by "OpenFont", a
handle to it is obtained by "StdFont".
INPUTS
RETURNS
E_FontPtr to the standard font
egsgfx.library/EG_Text
NAME
EG_Text render text into a rastport
SYNOPSIS
EG_Text(rast, text, len)
A0 A1 D0
EG_RastPortPtr rast;
CHAR * text;
WORD len;
FUNCTION
Renders a text into a rastport at the current cursorposition, using
current font and drawmode. After this operation the graphiccursor is
located at the end of the text.
INPUTS
RETURNS
egsgfx.library/EG_TextLength
NAME
EG_TextLength evaluates the width of a text
SYNOPSIS
length = EG_TextLength(rast, text, len)
D0 A0 A1 D0
WORD length;
EG_RastPortPtr rast;
CHAR * text;
WORD len;
FUNCTION
Evaluates the width of a text, as if it would be rendered using EG_Text.
INPUTS
RETURNS
width in pixels
egsgfx.library/EG_WritePixel
NAME
EG_WritePixel writes a pixel
SYNOPSIS
EG_WritePixel(rast, x, y)
A0 D0 D1
EG_RastPortPtr rast;
WORD x, y;
FUNCTION
Writes a pixel in to rastport, using the current drawmode and aPen.
INPUTS
RETURNS